#include "mainwindow.h"
#include "ui_mainwindow.h"

#include <QDockWidget>
#include <QFileSystemModel>
#include <QTreeView>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    this->m_dockWgt=new QDockWidget(tr("Tree model/view"),this);
    QFileSystemModel *model=new QFileSystemModel;
    model->setRootPath(QDir::currentPath());
    QTreeView *tree=new QTreeView(m_dockWgt);
    tree->setModel(model);
    m_dockWgt->setWidget(tree);
    this->addDockWidget(Qt::LeftDockWidgetArea,m_dockWgt);
}

MainWindow::~MainWindow()
{
    delete ui;
}
